<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.thymeleaf.org/extras/dialect"
      layout:decorate="layout/layout_login"
>
<head>
	<title>登录</title>
	<meta charset="utf-8"/>
	<link rel="stylesheet" href="../../static/asset/css/bootstrap.min.css" th:href="@{/asset/css/bootstrap.min.css}"/>
	<link rel="stylesheet" href="../../static/asset/css/base.min.css" th:href="@{/asset/css/base.min.css}"/>
	<link rel="stylesheet" href="../../static/asset/css/common/front.css" th:href="@{/asset/css/common/front.css}"/>
	<link rel="stylesheet" href="../../static/asset/css/back/login.css" th:href="@{/asset/css/back/login.css}"/>
</head>
<body>
<div layout:fragment="content" class="wrapper login-wrapper">
	<div class="login-container ">
		<form method="post" class="login-form " th:object="${user}">
			<div class="logo-name text-center mb-5">重置密码</div>

			<div class="form-group" th:if="${#bools.isFalse(mobileMode)}">
				<input id="username" name="username" type="text" class="form-control" placeholder="请输入找回密码的账号" th:field="*{username}"
					   required data-msg-required="不能为空">
				<div class="form-control-feedback text-danger" th:errors="*{username}"></div>
				<input id="email" name="email" type="text" class="form-control" placeholder="请输入账号绑定的电子邮箱" th:field="*{email}"
				       required data-rule-email="true" data-msg-email="不是有效的邮箱地址" data-msg-required="不能为空" style="margin-top: 20px;">
				<div class="form-control-feedback text-danger" th:errors="*{email}"></div>
			</div>

			<div class="form-group" th:if="${#bools.isTrue(mobileMode)}">
				<input id="username" name="username" type="text" class="form-control" placeholder="请输入找回密码的账号" th:field="*{username}"
					   required data-msg-required="不能为空">
				<div class="form-control-feedback text-danger" th:errors="*{username}"></div>
				<input id="mobile" name="mobile" type="text" class="form-control" placeholder="请输入账号绑定的电话号码" th:field="*{mobile}"
					   required data-msg-required="不能为空" style="margin-top: 20px;">
				<div class="form-control-feedback text-danger" th:errors="*{mobile}"></div>
			</div>

			<div class="form-group" style="margin-top: 30px;">
				<input type="submit" class="btn btn-block btn-primary" value="立即重置">
			</div>

			<div class="text-right">
				<a href="../login.html" th:href="@{/login}">已有账号，前往登录</a>
				<a href="./register.html" th:href="@{/register}" class="border border-primary border-bottom-0 border-top-0 border-right-0 pl-2 ml-1">注册新账号</a>
			</div>
		</form>
	</div>
</div>

<th:block layout:fragment="script">
	<script type="text/javascript" src="../../static/asset/js/base.min.js" th:src="@{/asset/js/base.min.js}"></script>
	<script type="text/javascript" src="../../static/asset/js/form.min.js" th:src="@{/asset/js/form.min.js}"></script>
	<script type="text/javascript" src="../../static/asset/js/app.js" th:src="@{/asset/js/app.js}"></script>
	<script>
		$(function () {
			$('form').validate({
				errorElement: 'div',
				errorClass: 'form-control-feedback text-danger'
			})
		})
	</script>
</th:block>
</body>
</html>
